package com.my12306.train.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.common.model.vo.PageVo;
import com.my12306.train.model.entity.MileageEntity;
import com.my12306.train.model.vo.MileageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
@Mapper
public interface MileageDao extends BaseMapper<MileageEntity> {

    /**
     * 分页查询
     * @param pageVo
     * @param logicDelete
     * @return
     */
    List<MileageVo> queryMileageByPage(@Param("pageVo") PageVo pageVo, @Param("logicDelete") Integer logicDelete);

    /**
     * 分页查询的总数据量
     * @param pageVo
     * @param logicDelete
     * @return
     */
    Integer queryMileageCount(@Param("pageVo") PageVo pageVo, @Param("logicDelete") Integer logicDelete);

    /**
     * 批量添加mileage
     * @param mileageList
     */
    void saveBatchMileage(@Param("list") List<MileageEntity> mileageList);

    /**
     * 批量删除里程
     * @param routeIds
     * @param logicDelete
     */
    void deleteMileageByRouteIds(@Param("list") List<Long> routeIds, @Param("logicDelete") Integer logicDelete);

    /**
     * 根据mileageId查询
     * @param mielageId
     * @param logicDelete
     * @return
     */
    MileageVo queryMileageVoByMileageId(@Param("mielageId") Long mielageId, @Param("logicDelete") int logicDelete);

    /**
     * 根据id查询
     * @param mileageId
     * @param logicDelete
     * @return
     */
    MileageEntity queryMileageByMileageId(@Param("mileageId") Long mileageId, @Param("logicDelete") int logicDelete);

    /**
     * 查询所有里程
     * @param logicDelete
     * @return
     */
    List<MileageEntity> queryAllMileage(@Param("logicDelete") int logicDelete);
}
